package com.jumi.microservice.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;

/**
 * 等级1.团购用户 2店长 3优秀店长 4金牌推广商
 */
public enum Level implements IEnum<Integer> {
    user(1, "团购用户"), manager(2, "店长"), goodManager(3, "优秀店长"), gold(4, "金牌推广商");

    private Integer value;
    private String desc;


    Level(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static Level getLevelByValue(int value) {
        Level[] values = Level.values();
        for (Level level : values) {
            if (level.value == value) {
                return level;
            }
        }
        return null;
    }

    @Override
    public Integer getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }


    @Override
    public String toString() {
        return "{\"value\":" + value + ",\"desc\":\"" + desc + "\"}";
    }
}
